//package com.sinothk.hussars.plugin.mybatis_plus;
//
//import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
//import com.baomidou.mybatisplus.core.toolkit.StringUtils;
//import com.baomidou.mybatisplus.generator.AutoGenerator;
//import com.baomidou.mybatisplus.generator.config.*;
//import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
//
//import java.util.Scanner;
//
//// 演示例子，执行 main 方法控制台输入模块表名回车自动生成对应项目目录中
//public class CodeGenerator {
//
////    /**
////     * <p>
////     * 读取控制台内容
////     * </p>
////     */
////    public static String scanner(String tip) {
////        Scanner scanner = new Scanner(System.in);
////        StringBuilder help = new StringBuilder();
////        help.append("请输入" + tip + "：");
////        System.out.println(help.toString());
////        if (scanner.hasNext()) {
////            String ipt = scanner.next();
////            if (StringUtils.isNotBlank(ipt)) {
////                return ipt;
////            }
////        }
////        throw new MybatisPlusException("请输入正确的" + tip + "！");
////    }
//
//    public static void main(String[] args) {
//
//        AutoGenerator mpg = new AutoGenerator();
//        //1、全局配置
//        GlobalConfig gc = new GlobalConfig();
////        String projectPath = System.getProperty("F:/SINOTHK/IT/Workspace/Hussars/HussarsBoot/hussars-boot-module-biz");
//        String projectPath = "F:\\SINOTHK\\IT\\Workspace\\Hussars\\HussarsBoot\\hussars-boot-module-biz";
//        gc.setOutputDir(projectPath + "/src/main/java");  //生成路径(一般都是生成在此项目的src/main/java下面)
//        gc.setAuthor("liangyt"); //设置作者
//        gc.setOpen(false);
//        gc.setFileOverride(true); //第二次生成会把第一次生成的覆盖掉 true
//        gc.setServiceName("%sService"); //生成的service接口名字首字母是否为I，这样设置就没有
//        gc.setBaseResultMap(true); //生成resultMap
//        gc.setBaseColumnList(true);
//        gc.setEntityName("%sEntity");
//        gc.setSwagger2(true);
//
//        mpg.setGlobalConfig(gc);
//
//        //2、数据源配置
//        DataSourceConfig dsc = new DataSourceConfig();
//        dsc.setUrl("jdbc:mysql://127.0.0.1:3306/zy_hsjc?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai");
//        dsc.setDriverName("com.mysql.cj.jdbc.Driver");
//        dsc.setUsername("root");
//        dsc.setPassword("root");
//        mpg.setDataSource(dsc);
//
//        // 3、包配置
//        PackageConfig pc = new PackageConfig();
////        pc.setModuleName("user");
//        pc.setParent("com.sinothk.hussars");
//        mpg.setPackageInfo(pc);
//
//        // 配置模板
//        TemplateConfig templateConfig = new TemplateConfig();
//        //控制 不生成 controller
////        templateConfig.setController("");
//        mpg.setTemplate(templateConfig);
//
//        // 4、策略配置
//        StrategyConfig strategy = new StrategyConfig();
//        strategy.setNaming(NamingStrategy.underline_to_camel);
//        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
//        strategy.setSuperControllerClass("com.sinothk.hussars.base.BaseController");
//        strategy.setSuperEntityClass("com.sinothk.hussars.base.BaseEntity");
//        strategy.setEntityLombokModel(true); //使用lombok
//        strategy.setRestControllerStyle(true);
//
//        strategy.setTablePrefix("tab_"); // 表名前缀
//
////        strategy.setInclude("tab_file","tab_org","tab_permissions","tab_permissions_user","tab_record",
////                "tab_record_invalid","tab_record_process","tab_role","tab_user","tab_worker");
//        // ,"tab_worker_manager","tab_worker_checker" //,"tab_org_check","tab_org_collect" tab_wx_user
//
//        strategy.setInclude("tab_org_manager");
//
//        strategy.setControllerMappingHyphenStyle(true);
//
//        mpg.setStrategy(strategy);
//        //5、执行
//        mpg.execute();
//    }
//
//}
